package com.ds.robot.assistant.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import lombok.Data;

/**
 * 缺陷信息表
 *
 * @TableName bug_info
 */
@TableName(value = "bug_info")
@Data
public class BugInfo implements Serializable {
    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 云效缺陷ID
     */
    private String identifier;

    /**
     * 缺陷名称
     */
    private String subject;

    /**
     * 状态Id
     */
    private String statusIdentifier;

    /**
     * 状态
     */
    private String status;

    /**
     * 负责人账号
     */
    private String assignedTo;

    /**
     * 负责人姓名
     */
    private String assignedToName;

    /**
     * 创建者账号
     */
    private String creator;

    /**
     * 创建者姓名
     */
    private String creatorName;

    /**
     * 创建时间戳，单位毫秒
     */
    private Long gmtCreate;

    /**
     * 修改时间戳，单位毫秒
     */
    private Long gmtModified;

    /**
     * 完成时间戳，单位毫秒
     */
    private Long finishTime;

    /**
     * 项目ID
     */
    private String spaceId;

    /**
     * 项目名称
     */
    private String spaceName;

    /**
     * 创建时间
     */
    private Date createdAt;

    /**
     * 修改时间
     */
    private Date updatedAt;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        BugInfo other = (BugInfo) that;
        return //(this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) &&
                (this.getIdentifier() == null ? other.getIdentifier() == null : this.getIdentifier().equals(other.getIdentifier()))
                        && (this.getSubject() == null ? other.getSubject() == null : this.getSubject().equals(other.getSubject()))
                        && (this.getStatusIdentifier() == null ? other.getStatusIdentifier() == null : this.getStatusIdentifier().equals(other.getStatusIdentifier()))
                        && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
                        && (this.getAssignedTo() == null ? other.getAssignedTo() == null : this.getAssignedTo().equals(other.getAssignedTo()))
                        && (this.getAssignedToName() == null ? other.getAssignedToName() == null : this.getAssignedToName().equals(other.getAssignedToName()))
                        && (this.getCreator() == null ? other.getCreator() == null : this.getCreator().equals(other.getCreator()))
                        && (this.getCreatorName() == null ? other.getCreatorName() == null : this.getCreatorName().equals(other.getCreatorName()))
                        && (this.getGmtCreate() == null ? other.getGmtCreate() == null : this.getGmtCreate().equals(other.getGmtCreate()))
                        && (this.getGmtModified() == null ? other.getGmtModified() == null : this.getGmtModified().equals(other.getGmtModified()))
                        && (this.getFinishTime() == null ? other.getFinishTime() == null : this.getFinishTime().equals(other.getFinishTime()))
                        && (this.getSpaceId() == null ? other.getSpaceId() == null : this.getSpaceId().equals(other.getSpaceId()))
                        && (this.getSpaceName() == null ? other.getSpaceName() == null : this.getSpaceName().equals(other.getSpaceName()))
                // && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
                // && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()))
                ;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getIdentifier() == null) ? 0 : getIdentifier().hashCode());
        result = prime * result + ((getSubject() == null) ? 0 : getSubject().hashCode());
        result = prime * result + ((getStatusIdentifier() == null) ? 0 : getStatusIdentifier().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getAssignedTo() == null) ? 0 : getAssignedTo().hashCode());
        result = prime * result + ((getAssignedToName() == null) ? 0 : getAssignedToName().hashCode());
        result = prime * result + ((getCreator() == null) ? 0 : getCreator().hashCode());
        result = prime * result + ((getCreatorName() == null) ? 0 : getCreatorName().hashCode());
        result = prime * result + ((getGmtCreate() == null) ? 0 : getGmtCreate().hashCode());
        result = prime * result + ((getGmtModified() == null) ? 0 : getGmtModified().hashCode());
        result = prime * result + ((getFinishTime() == null) ? 0 : getFinishTime().hashCode());
        result = prime * result + ((getSpaceId() == null) ? 0 : getSpaceId().hashCode());
        result = prime * result + ((getSpaceName() == null) ? 0 : getSpaceName().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", identifier=").append(identifier);
        sb.append(", subject=").append(subject);
        sb.append(", statusIdentifier=").append(statusIdentifier);
        sb.append(", status=").append(status);
        sb.append(", assignedTo=").append(assignedTo);
        sb.append(", assignedToName=").append(assignedToName);
        sb.append(", creator=").append(creator);
        sb.append(", creatorName=").append(creatorName);
        sb.append(", gmtCreate=").append(gmtCreate);
        sb.append(", gmtModified=").append(gmtModified);
        sb.append(", finishTime=").append(finishTime);
        sb.append(", spaceId=").append(spaceId);
        sb.append(", spaceName=").append(spaceName);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", updatedAt=").append(updatedAt);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
